using System;
using System.Collections.Generic;
using System.Text;
using IMAPI2;
using System.Runtime.InteropServices;

namespace IMAPIWrapper
{
    public class DiscRecorder
    {
        internal MsftDiscRecorder2 internalRecorder;
        public DiscRecorder()
        {
            internalRecorder = new MsftDiscRecorder2Class();
        }
        internal DiscRecorder(MsftDiscRecorder2 givenRecorder)
        {
            internalRecorder = givenRecorder;
        }
        #region IDiscRecorder2 Members

        public void AcquireExclusiveAccess(bool force, string __MIDL__IDiscRecorder20000)
        {
            internalRecorder.AcquireExclusiveAccess(force, __MIDL__IDiscRecorder20000);
        }

        public string ActiveDiscRecorder
        {
            get { return internalRecorder.ActiveDiscRecorder; }
        }

        public void CloseTray()
        {
            internalRecorder.CloseTray();
        }

        public Array CurrentFeaturePages
        {
            get { return internalRecorder.CurrentFeaturePages; }
        }

        public Array CurrentProfiles
        {
            get { return internalRecorder.CurrentProfiles; }
        }

        public bool DeviceCanLoadMedia
        {
            get { return DeviceCanLoadMedia; }
        }

        public void DisableMcn()
        {
            internalRecorder.DisableMcn();
        }

        public void EjectMedia()
        {
            internalRecorder.EjectMedia();
        }

        public void EnableMcn()
        {
            internalRecorder.EnableMcn();
        }

        public string ExclusiveAccessOwner
        {
            get { return internalRecorder.ExclusiveAccessOwner; }
        }

        public void InitializeDiscRecorder(string recorderUniqueId)
        {
            try
            {
                internalRecorder.InitializeDiscRecorder(recorderUniqueId);
            }
            catch (COMException)
            {
                throw new InvalidOperationException();
            }
        }

        public int LegacyDeviceNumber
        {
            get { return internalRecorder.LegacyDeviceNumber; }
        }

        public string ProductId
        {
            get { return internalRecorder.ProductId; }
        }

        public string ProductRevision
        {
            get { return internalRecorder.ProductRevision; }
        }

        public void ReleaseExclusiveAccess()
        {
            internalRecorder.ReleaseExclusiveAccess();
        }

        public Array SupportedFeaturePages
        {
            get { return internalRecorder.SupportedFeaturePages; }
        }

        public Array SupportedModePages
        {
            get { return internalRecorder.SupportedModePages; }
        }

        public Array SupportedProfiles
        {
            get { return internalRecorder.SupportedProfiles; }
        }

        public string VendorId
        {
            get { return internalRecorder.VendorId; }
        }

        public string VolumeName
        {
            get { return internalRecorder.VolumeName; }
        }

        public Array VolumePathNames
        {
            get { return internalRecorder.VolumePathNames; }
        }

        #endregion
    }
}
